package com.mike.billingserver.vo;

import com.mike.billingserver.constant.ApplicationConstant;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @author xiaozefeng
 * @date 2018-12-19 16:02
 */
@Data
public class HappenedTimeVO {

    private String name;

    private String value;

    private HappenedTimeVO(String name, String value) {
        this.name = name;
        this.value = value;
    }

    private HappenedTimeVO() {

    }

    public static List<HappenedTimeVO> generateList() {
        LocalDateTime now = LocalDateTime.now();
        List<HappenedTimeVO> result = new ArrayList<>();
        result.add(new HappenedTimeVO("大前天", now.minusDays(3).format(ApplicationConstant.DEFAULT_TIME_FORMATTER)));
        result.add(new HappenedTimeVO("前天", now.minusDays(2).format(ApplicationConstant.DEFAULT_TIME_FORMATTER)));
        result.add(new HappenedTimeVO("昨天", now.minusDays(1).format(ApplicationConstant.DEFAULT_TIME_FORMATTER)));
        //result.add(new HappenedTimeVO("今天", now.format(ApplicationConstant.DEFAULT_TIME_FORMATTER)));
        result.add(new HappenedTimeVO("明天", now.plusDays(1).format(ApplicationConstant.DEFAULT_TIME_FORMATTER)));
        result.add(new HappenedTimeVO("后天", now.plusDays(2).format(ApplicationConstant.DEFAULT_TIME_FORMATTER)));
        result.add(new HappenedTimeVO("大后天", now.plusDays(3).format(ApplicationConstant.DEFAULT_TIME_FORMATTER)));
        return result;
    }

}
